Public Class FRMAbout

    Private Sub FRMAbout_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        lbl3.Text = My.Application.Info.Copyright
        lbl2.Text = "Company: " + My.Application.Info.CompanyName
        lbl4.Text = "Product: " + My.Application.Info.ProductName
        lbl2.Location = New Point((Me.Width / 2) - (lbl2.Width / 2), lbl2.Location.Y)
        lbl3.Location = New Point((Me.Width / 2) - (lbl3.Width / 2), lbl3.Location.Y)
        lbl4.Location = New Point((Me.Width / 2) - (lbl4.Width / 2), lbl4.Location.Y)
        CreateBackground()
    End Sub
    Public Sub CreateBackground()
        Dim bmp As New Bitmap(Me.Width, Me.Height)
        Dim graph As Graphics = Graphics.FromImage(bmp)
        Dim rect1 As Rectangle = GetRect(pb1, 50)
        Dim rect2 As Rectangle = GetRect(lbl1, 60)
        Dim rect3 As Rectangle = GetRect(lbl2, 40)
        Dim rect4 As Rectangle = GetRect(lbl3, 40)
        Dim rect5 As Rectangle = GetRect(lbl4, 40)
        Dim rect6 As Rectangle = GetRect(lbl5, 40)
        Dim rect7 As Rectangle = GetRect(Button1, 20)
        Dim bmp1 As New Bitmap(rect1.Width, rect1.Height)
        Dim bmp2 As New Bitmap(rect2.Width, rect2.Height)
        Dim bmp3 As New Bitmap(rect3.Width, rect3.Height)
        Dim bmp4 As New Bitmap(rect4.Width, rect4.Height)
        Dim bmp5 As New Bitmap(rect5.Width, rect5.Height)
        Dim bmp6 As New Bitmap(rect6.Width, rect6.Height)
        Dim bmp7 As New Bitmap(rect7.Width, rect7.Height)
        bmp1 = ReflectionLib.CreateFade(SetColor(bmp1, pb1.BackColor), 25)
        bmp2 = ReflectionLib.CreateFade(SetColor(bmp2, lbl1.BackColor), (30))
        bmp3 = ReflectionLib.CreateFade(SetColor(bmp3, lbl2.BackColor), 20)
        bmp4 = ReflectionLib.CreateFade(SetColor(bmp4, lbl3.BackColor), 20)
        bmp5 = ReflectionLib.CreateFade(SetColor(bmp5, lbl4.BackColor), 20)
        bmp6 = ReflectionLib.CreateFade(SetColor(bmp6, lbl5.BackColor), 20)
        bmp7 = ReflectionLib.CreateFade(SetColor(bmp7, Color.Green), (20 / 2))
        Dim b As New LinearGradientBrush(New Rectangle(0, 0, Me.Width, Me.Height), Color.Black, Color.White, 66)
        Dim cl As New ColorBlend
        cl.Colors = New Color() {Color.Blue, Color.Yellow, Color.Crimson, Color.Cyan, Color.BurlyWood}
        cl.Positions = New Single() {0.0, 0.25, 0.5, 0.75, 1.0}
        b.InterpolationColors = cl
        graph.FillRectangle(b, New Rectangle(0, 0, Me.Width, Me.Height))
        graph.DrawImage(bmp1, rect1.Location)
        graph.DrawImage(bmp2, rect2.Location)
        graph.DrawImage(bmp3, rect3.Location)
        graph.DrawImage(bmp4, rect4.Location)
        graph.DrawImage(bmp5, rect5.Location)
        graph.DrawImage(bmp6, rect6.Location)
        graph.DrawImage(bmp7, rect7.Location)
        Me.BackgroundImage = bmp
    End Sub
    Public Function GetRect(ByVal c As Control, ByVal extra As Integer) As Rectangle
        a = extra / 2 '12.5
        b = extra '25
        Dim rect1 As New Rectangle(c.Location.X - a, c.Location.Y - a, c.Width + b, c.Height + b)
        Return rect1
    End Function
    Public Function SetColor(ByVal bmp As Bitmap, ByVal clr As Color) As Bitmap
        Dim graph As Graphics = Graphics.FromImage(bmp)
        Dim b As SolidBrush = Brushes.Black
        b.Color = clr
        graph.FillRectangle(b, New Rectangle(0, 0, bmp.Width, bmp.Height))
        Return bmp
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub
End Class